package com.itany.shop.util;

import java.util.Date;
import java.util.Random;

/**
 * @Author:石小俊
 * @Date:2022/12/15 11:06
 * @Version:1.0-SNAPSHOT
 * @Description:
 */
public class ParameterUtil {

    public static boolean isNull(String s){
        return null == s || "".equals(s);
    }

    /**
     * 创建随机订单号
     * 订单号规则:随机四位英文字母下划线+毫秒数
     * @return
     */
    public static String createNo(){
        String s = "qwertyuioplkjhgfdsazxcvbnm_";
        StringBuffer buffer = new StringBuffer();
        for(int i = 0; i < 4; i++){
            buffer.append(s.charAt(new Random().nextInt(s.length())));
        }
        return buffer.toString()+new Date().getTime();
    }
}
